package cm.xvexi02;

import java.util.Scanner;

public class Test {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        Fruit f = new Apple();
        System.out.println("请输入苹果的名称");
        f.setName(sc.next());
        System.out.println("请输入苹果的产地");
        f.setArea(sc.next());
        System.out.println("请输入苹果的价格");
        f.setPrice(sc.nextDouble());
        String string = f.toString();
        System.out.println(string);
        System.out.println("------------------------------------------------------------------------");
        Fruit f1 = new Lingmeng();
        System.out.println("请输入柠檬的名称");
        f1.setName(sc.next());
        System.out.println("请输入柠檬的产地");
        f1.setArea(sc.next());
        System.out.println("请输入柠檬的价格");
        f1.setPrice(sc.nextDouble());
        String string1 = f1.toString();
        System.out.println(string1);
        System.out.println("--------------------------------------------------------------------------");
        Fruit f2=new Caomei();
        System.out.println("请输入草莓的名称");
        f2.setName(sc.next());
        System.out.println("请输入草莓的产地");
        f2.setArea(sc.next());
        System.out.println("请输入草莓的价格");
        f2.setPrice(sc.nextDouble());
        String string2 = f2.toString();
        System.out.println(string2);
    }
}
